<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/24 0024
 * Time: 15:02
 */

namespace app\pay\controller;


use app\jointly\controller\Base;

require EXTEND_PATH.'zfb/AopSdk.php';
class Zfu extends Base
{
    public function GetZfbData(){
        $c = new \AopClient();
        $c->gatewayUrl = 'https://openapi.alipay.com/gateway.do';
        $c->appId = '2019062065611567';
        $c->rsaPrivateKey = str_replace(['\r\n',' '],['',''],'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvRU9H2QDEKnSgFgDrG4pqTHorJTPoleZfhJlC6TmWWREkyuly5TmRnScZDUCA6b7S/Gs37KhqGsK7qr9L70qlqC36WIWQu9qiiTth+BVoh1oGLIBpFrtZMLJHWONI1ZILLLvl+C8I83ZY6NSA0by8MyLKLgAM994gnfQzZF/Ll/DZNtcKy3GcPdSF+40w2MUZWGvIDcepMwPkfTqrMNhjxL6Srw7ATUQz25f8ShFSYgl0UE0JjJPA6r+GMmRuNzByrUVegD3dbd0kiCfUwlx6AoA42t/fbaHkfLKRKhhz0uHUJUOG/keuRvYbIiyY1s68cGyXafA0ugP5DuyhJz48wIDAQAB');
        $c->format = 'json';
        $c->signType = 'RSA2';
        $c->alipayrsaPublicKey= '2088531351752811';
       // var_dump($c);die;
        $request = new \AlipayOpenPublicTemplateMessageIndustryModifyRequest();
//SDK已经封装掉了公共参数，这里只需要传入业务参数
//此次只是参数展示，未进行字符串转义，实际情况下请转义
        $request->setBizContent("{" .
            "    \"primary_industry_name\":\"IT科技/IT软件与服务\"," .
            "    \"primary_industry_code\":\"10001/20102\"," .
            "    \"secondary_industry_code\":\"10001/20102\"," .
            "    \"secondary_industry_name\":\"IT科技/IT软件与服务\"" .
            " }");
        $response= $c->execute($request);
        return $this->returnSuccess($response);
    }
}